-
Notifications
You must be signed in to change notification settings - Fork 134
Expose the .ForEach() and .Where() methods as regular PowerShell operators #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Follow-up from discussion at PowerShell/PowerShell#6576
|
|
||
|
|
||
| It's probably worth creating a new conceptual help topic titled `about_Collection_Operators` to describe these new operators. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: all of the comparison operators work with collections e.g. "a", "b", "c", "d" -match "[bc]" will return "b", "c".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrucePay: Good point, but the new operators are not about also working on collections; their whole purpose is to operate on collections; additionally, their purpose is open-ended, given that the meat of the behavior is in the script blocks passed.
So my suggestion is to have the new topic mention the collection-processing capabilities of comparison operators such as -eq and -match and link to about_comparison_operators.
|
@mklement0 I believe it makes sense to add a description of exception behavior in the operators. |
|
@iSazonov: Thanks; I've added a note re error handling, operator precedence, and |
|
Currently, we on the @PowerShell/powershell-committee think that introducing what amounts to a third (or fourth) reference to "foreach" ( Instead, we think it's probably a good idea to come up with some ScriptAnalyzer rules and accompanying documentation that explain why it might not be a good idea to use |
|
Thanks for writing this, though @mklement0. Very through provoking, and we're not opposed to ever doing it, but I am going to merge this one into the Rejected state now for posterity. |
As originally discussed in PowerShell/PowerShell#6576